package beans;

import db.Entity;

import java.sql.Timestamp;

public class Group extends Entity {

    public final static int MAX_GROUP_NAME_LENGTH = 255; //限制群组名最大长度
    public final static int MIN_GROUP_NAME_LENGTH = 2; //限制群组名最小长度

    public static boolean isGroupNameLegal(String group_name) {
        return group_name != null &&
                group_name.length() >= MIN_GROUP_NAME_LENGTH &&
                group_name.length() <= MAX_GROUP_NAME_LENGTH;
    }

    @Override
    public String tableName() {
        return "wb_group";
    }

    private long id;
    private long admin_id;
    private String group_name;
    private Timestamp create_time;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getAdmin_id() {
        return admin_id;
    }

    public void setAdmin_id(long admin_id) {
        this.admin_id = admin_id;
    }

    public String getGroup_name() {
        return group_name;
    }

    public void setGroup_name(String group_name) {
        this.group_name = group_name;
    }

    public Timestamp getCreate_time() {
        return create_time;
    }

    public void setCreate_time(Timestamp create_time) {
        this.create_time = create_time;
    }
}
